import { createApp } from 'vue';
import App from './App.vue';
const app = createApp(App);

import './style.css';
// 自定义样式
import '@/styles/index.scss';

// 路由
import router from '@/router';

// 全局过滤器
import { filters } from '@/utils/filters.js';

// 引入element Plus
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';

// 注册所有图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// 引入pinia
import { createPinia } from 'pinia';
const pinia = createPinia();

// pinia持久化存储
import { createPersistedState } from 'pinia-plugin-persistedstate';
pinia.use(
  createPersistedState({
    auto: true, // 启用所有 Store 默认持久化
  })
);

import FileUpload from '@/components/FileUpload/index.vue';
import Pagination from '@/components/Pagination/index.vue';


// 高德地图
window._AMapSecurityConfig = {
  securityJsCode: '0ca861bb10c206574fbfeb1eb294ca69', //*  安全密钥
};

app.component('FileUpload', FileUpload);
app.component('Pagination', Pagination);

import store from '@/store';
app.config.globalProperties.$store = store;
app.config.globalProperties.$filters = filters;
app.config.globalProperties.mapJsKey = '2980df74cf6c1b60c9d096e5c8e519e2';
app.use(pinia);
app.use(router);
// size从cookie获取,用户自定义大小
app.use(ElementPlus, { size: 'small', zIndex: 3000 });
app.mount('#app');
